package com.lantosec.hmrp.modules.system.vo;

import com.lantosec.hmrp.modules.system.entity.SysMenu;
import com.lantosec.hmrp.core.mvc.BaseVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * <p>
 * 系统菜单表 VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-02-12
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="SysMenu对象", description="系统菜单表")
public class SysMenuVO extends BaseVO<SysMenu> {
    private static final long serialVersionUID = 1L;


    public SysMenuVO(SysMenu entity){
        this.menuId = entity.getMenuId();
        this.showName = entity.getShowName();
        this.menuName = entity.getMenuName();
        this.ico = entity.getIco();
        this.url = entity.getUrl();
        this.parentId = entity.getParentId();
        this.state = entity.getState();
        this.menuOrder = entity.getMenuOrder();
        this.ext = entity.getExt();
        this.flag = entity.getFlag();
    }

    @Override
    public SysMenu convertToEntity(){
        return new SysMenu(this);
    }


    @ApiModelProperty(value = "菜单ID")
    private String menuId;

    @ApiModelProperty(value = "菜单显示名称")
    private String showName;

    @ApiModelProperty(value = "菜单名称")
    private String menuName;

    @ApiModelProperty(value = "菜单图标")
    private String ico;

    @ApiModelProperty(value = "菜单路径")
    private String url;

    @ApiModelProperty(value = "上级菜单ID")
    private String parentId;

    @ApiModelProperty(value = "状态(0正常1废止)")
    private Integer state;

    @ApiModelProperty(value = "排序")
    private Integer menuOrder;

    @ApiModelProperty(value = "扩展字段")
    private String ext;

    @ApiModelProperty(value = "是否删除")
    private Boolean flag;
}
